<?php
/*! \brief
 * This is Simple Factory Framework class of Widget Framewok 2.0 /path/to/widget_old
 * And shot cut of widget pool relative object 
 * You can get all of the object of Widget Framework via this class
 *\author William Su
 */
require_once dirname(__FILE__).'/WFFrom.abstract.php';
class WFFrom20 extends AWFFrom
{
	/**
	 *\brief Description
	 * This method will return object of WFDataObject
	 * @return WFDatabaseObjectSqlite
	 */
    public function getDataObject(){
        if(!isset(self::$instance[__FUNCTION__])){
			require($this->getDocumentRoot().'/inc/config.php');
			$strDBType = $this->objFramework->getConfigFactory()->getConfig()->getDbConfigType();
			$strDBTypeUpperCamelCase = $this->objFramework->getTypeFactory()->getString()->getUpperCamelCase($strDBType);
			require_once($this->objFramework->getDocumentRoot().'/inc/class/common/db/DatabaseObject'.$strDBTypeUpperCamelCase.'.php');
			$strFuncDatabaseObject = 'WFDatabaseObject'.$strDBTypeUpperCamelCase;
			self::$instance[__FUNCTION__] = new $strFuncDatabaseObject($wfconf_dbconfig, $this->objFramework);
		}
		$ret = self::$instance[__FUNCTION__];
		return $ret;
	}
}